Telegram Group & Telegram Channel
Can't get request.POST with HTMX + Checked Attribute

I'm printing the POST result like this:

print(self.request.POST)

In the template, I'm trying to POST the name and value of the input field. It works when the checked attribute is not there but gives me an empty QueryDict <QueryDict: {}> when it's there as per below.

<div class="form-check form-switch">
                 <input
                   class="form-check-input"
                   type="checkbox"
                   role="switch"
                   id="survey-{{ survey.pk }}"
                   name="button"
                   value="{{ survey.published }}"
                   hx-post="{% url 'surveys:survey-toggle-status' %}"
                   hx-trigger="click"
                   hx-target="#survey-table"
           

/r/django
https://redd.it/1dn85zr



tg-me.com/pythondaily/33168
Create:
Last Update:

Can't get request.POST with HTMX + Checked Attribute

I'm printing the POST result like this:

print(self.request.POST)

In the template, I'm trying to POST the name and value of the input field. It works when the checked attribute is not there but gives me an empty QueryDict <QueryDict: {}> when it's there as per below.

<div class="form-check form-switch">
                 <input
                   class="form-check-input"
                   type="checkbox"
                   role="switch"
                   id="survey-{{ survey.pk }}"
                   name="button"
                   value="{{ survey.published }}"
                   hx-post="{% url 'surveys:survey-toggle-status' %}"
                   hx-trigger="click"
                   hx-target="#survey-table"
           

/r/django
https://redd.it/1dn85zr

BY Python Daily




Share with your friend now:
tg-me.com/pythondaily/33168

View MORE
Open in Telegram


Python Daily Telegram | DID YOU KNOW?

Date: |

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

Should I buy bitcoin?

“To the extent it is used I fear it’s often for illicit finance. It’s an extremely inefficient way of conducting transactions, and the amount of energy that’s consumed in processing those transactions is staggering,” the former Fed chairwoman said. Yellen’s comments have been cited as a reason for bitcoin’s recent losses. However, Yellen’s assessment of bitcoin as a inefficient medium of exchange is an important point and one that has already been raised in the past by bitcoin bulls. Using a volatile asset in exchange for goods and services makes little sense if the asset can tumble 10% in a day, or surge 80% over the course of a two months as bitcoin has done in 2021, critics argue. To put a finer point on it, over the past 12 months bitcoin has registered 8 corrections, defined as a decline from a recent peak of at least 10% but not more than 20%, and two bear markets, which are defined as falls of 20% or more, according to Dow Jones Market Data.

Python Daily from us


Telegram Python Daily
FROM USA